package com.i5tong.mvpdemo.view;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.i5tong.mvpdemo.R;
import com.i5tong.mvpdemo.bean.WeatherInfoContainer;
import com.i5tong.mvpdemo.presenter.WeatherPresenter;


public class WeatherActivity extends Activity implements WeatherInterface {

    private TextView weatherText;

    private WeatherPresenter weatherPresenter;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        weatherText = (TextView)findViewById(R.id.text);

        weatherPresenter = new WeatherPresenter(this);
        weatherPresenter.queryWeatherInfo();
    }

    @Override
    public void onWeatherLoad(WeatherInfoContainer weatherInfoContainer) {
        weatherText.setText(weatherInfoContainer.getWeatherinfo().toString());
    }
}
